<template>
  <span class="_before">订单分配</span>
  <el-row class="marginTop20">
    <el-col :span="24" >经办人</el-col>
    <el-col :span="4" class="marginTop10">
      <el-input v-if="rowData[0]" v-model="rowData[0].handleUserName" disabled style="width: 60%;"></el-input>
    </el-col>
  </el-row>
  <el-row class="marginTop20">
    <el-col :span="6">业务员</el-col>
    <el-col :span="6">操作员</el-col>
    <el-col :span="6">业务编号</el-col>
  </el-row>
  <template v-for="item in rowData" :key="item">
    <el-row class="marginTop10">
      <el-col :span="6">
        <el-input v-model="item.businessUserName" disabled style="width: 60%;"></el-input>
      </el-col>
      <el-col :span="6">
          <el-input :value="formateOperater(item.operateUser)"  disabled style="width: 60%;"></el-input>
      </el-col>
      <el-col :span="6">
        <el-input v-model="item.businessNo" disabled style="width: 60%;"></el-input>
      </el-col>
    </el-row>
  </template>
  
</template>

<script setup lang="ts">
import {  onActivated, ref, computed } from 'vue'

const props = defineProps({
  readOnly: {
    type: Boolean,
    default: false
  },
  rowData: {
    type: Object,
    default: () => { }
  }
})

const operater = ref('')

const formateOperater = (list: any) => {
  if (!list) return ''
  let operateUserName = ''
  list.forEach((item: any, index: number) => {
    operateUserName = item.operateUserName + "、" + operateUserName
  })
  operater.value = operateUserName.replace(/^、|、$/g, '')
  return operateUserName.replace(/^、|、$/g, '')
}

defineExpose({
  // allocation: param.allocation,
  // onSubmit: onSubmit
})

</script>
<style scoped></style>